import type { App } from 'vue'
import './src/styles/global.less'

export * from './src/index'
export default {
  install: (app: App) => {
    const components: any = {}
    const modules = import.meta.glob('./src/modules/*.vue', { eager: true })

    Object.keys(modules).forEach((k) => {
      const key = k.replace('./src/modules/', '').replace('.vue', '')
      components[key] = modules[k]
      app.component(key, (modules as any)[k].default)
    })
  }
}
